import React, { useState, forwardRef, useImperativeHandle } from 'react';
import { Button, Drawer } from 'antd';
const index = (props, ref) => {
  const [open, setOpen] = useState(false);
  useImperativeHandle(ref, () => {
    return {
      open() {
        setOpen(true);
      },
      close() {
        setOpen(false);
      },
    };
  });

  return (
    <>
      <Drawer title="Basic Drawer" open={open} onClose={() => setOpen(false)} {...props}></Drawer>
    </>
  );
};

export default forwardRef(index);
